NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Technical Q&A ME04
Determining the Size of the Disk Cache

Q: How do I determine the size of the Disk Cache set from the Memory Control Panel?

A: The disk cache is currently (System 7) stored in the SysParmType record, which you can retrieve with the GetSysPPtr call (documented in Inside Macintosh:Operating Systems Utilities, chapter 7). The misc field contains the size of the disk cache in 32K chunks stored in bits 8-15.

You can access this information using code such as:



#include <OSUtils.h>
short GetDiskCacheSize(void) {
    SysPPtr pramPtr;
    short diskCacheSize;

    pramPtr = GetSysPPtr();

    diskCacheSize = ( ((unsigned short)(pramPtr->misc)) >> 8 ) * 32;
        /* diskCacheSize is now the size in K of the disk cache */

    return(diskCacheSize);
}


[Jul 03 1996]


Developer Documentation | Technical Notes | Development Kits | Sample Code